﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageAccessRight.aspx.cs" Inherits="BOH.DataManagement.ManageAccessRight" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../style/css.css" type="text/css" rel="Stylesheet" />
    
    <script src="../js/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="../js/common.js" type="text/javascript"></script>

<script>
    function ShowNew() {
        $("#divrightNew").slideToggle("slow");
    }
</script>
    
</head>
<body>
  
    <form id="form1" runat="server">
    <div id="divNavigation">
       当前位置:<a href="OverView.aspx" target="frameControl">后台数据管理</a> >> 权限管理
    </div>
    <div id="bodyDiv">
         <div id="divSearch">
            <a href="#" onclick="ShowNew()">新增权限</a>
         </div>
         <div id="divrightNew" style="display: none">
            <center>
                <table width="98%" style="margin-top:15px" class="Grid">
                    <tr>
                        <td>权限名称:</td>
                        <td><asp:TextBox ID="txtRightName" runat="server"></asp:TextBox></td>
                        <td>权限类型:</td>
                        <td>
                            <asp:DropDownList ID="drpRightList" runat="server" Width="130px" Height="22px">
                                 <asp:ListItem Value="A">系统管理员</asp:ListItem>
                                <asp:ListItem Value="C">中心用户组</asp:ListItem>
                                <asp:ListItem Value="G">主管局用户组</asp:ListItem>
                                <asp:ListItem Value="U">单位用户组</asp:ListItem>
                                <asp:ListItem Value="P">个人用户组</asp:ListItem>
                                <asp:ListItem Value="S">学科组管理员</asp:ListItem>
                                <asp:ListItem Value="Q">试题组管理员</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>权限编码:</td>
                        <td><asp:TextBox ID="txtRightCode" runat="server"></asp:TextBox></td>
                        <td><asp:Button id="butSaveRight" runat="server" Text="保存" width="100px" 
                                onclick="butSaveRight_Click"/></td>
                    </tr>
                </table>
            </center>
         </div>
     </div>
     <div id="divGrid">
             <asp:GridView ID="RightList" runat="server" AutoGenerateColumns="False"  Width="98%"
            CssClass="Grid" AllowPaging="True" PageSize="15" DataKeyNames="RightID" 
            onrowdatabound="RightList_RowDataBound" 
            onrowediting="RightList_RowEditing" 
            onrowcancelingedit="RightList_RowCancelingEdit" 
            onrowupdating="RightList_RowUpdating">
            <PagerSettings Mode="NumericFirstLast" />
            <RowStyle  Height="20px"/>
            <Columns>
                <asp:TemplateField HeaderText="权限名称" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="labRightName" runat="server"><%#Eval("RightName")%></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtRightName" runat="server" Text='<%#Eval("RightName") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="用户权限组" HeaderStyle-Width="220px" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="labRightTpye" Text='<%#getAccess(Eval("RightType").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:HiddenField ID="hiddenrightID" runat="server" Value='<%#Eval("RightID") %>' />
                        <asp:HiddenField ID="hiddenRight" runat="server" Value='<%#Eval("RightType") %>' />
                        <asp:DropDownList ID="drpAccessList" runat="server" Width="100px" Height="22px">
                                <asp:ListItem Value="A">系统管理员</asp:ListItem>
                                <asp:ListItem Value="C">中心用户组</asp:ListItem>
                                <asp:ListItem Value="G">主管局用户组</asp:ListItem>
                                <asp:ListItem Value="U">单位用户组</asp:ListItem>
                                <asp:ListItem Value="P">个人用户组</asp:ListItem>
                                <asp:ListItem Value="S">学科组管理员</asp:ListItem>
                                <asp:ListItem Value="Q">试题组管理员</asp:ListItem>
                        </asp:DropDownList>
                     </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="权限编码" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="labRightCode" Text='<%#Eval("RightCode")%>' runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtRightCode" value='<%#Eval("RightCode")%>' runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField HeaderText="修改" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="100px" ButtonType="Link"  EditText="修改" ShowCancelButton="true" ShowEditButton="true" CancelText="取消" UpdateText="保存" />
            </Columns>
            <AlternatingRowStyle CssClass="ARow" />
        </asp:GridView>
        <div id="divPager">
           <asp:Label ID="labNoRecord" Visible="false" runat="server" Text="查询结果为空!"></asp:Label>
            <webdiyer:aspnetpager id="AspNetPager1" runat="server" PageSize="15" AlwaysShow="True" OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Left" CustomInfoSectionWidth="35%" ShowPageIndexBox="always" PageIndexBoxType="DropDownList"
    CustomInfoHTML="第<font color='red'><b>%currentPageIndex%</b></font>页，共%PageCount%页，每页显示%PageSize%条记录"></webdiyer:aspnetpager>
        </div>
     </div>
    </form>
</body>
</html>

